Here's the source for ONCE - a windows utility that starts other apps and then will switch to that instance rather than starting a new instance. The command line for ONCE is
ONCE ininame
where ininame is the name of a standard windows ini file with the following information
[PARAMETERS]
AppFileName=file name of app to run - including path
AppTitle= the name to appear on the Title bar*
WorkingDir=path for working directory*
IconFile=file name and path of icon file*
IconNumber=index of icon in icon file 0=first*
* the last four parameters are only required for DOS apps.
Windows apps ignore them.
This program is useful for new users and in our company's case where two instances of a DOS comm app crash and it is critical to avoid starting the second instance.